package com.lagou.homework.part04

import akka.actor.{Actor, ActorRef}

/**
 * @author: yehw
 * @date: 2020/10/9 23:02
 * @description: actor通信
 */
class AActor extends Actor {
  override def receive: Receive = {
    case "start ok!"
    => sender !"我打"
      println("我打")
    case "降龙十八掌第一掌"
    => sender!"佛山无影脚，第一脚"
      println("佛山无影脚，第一脚")
    case "降龙十八掌第二掌"
    => sender!"佛山无影脚，第二脚"
      println("佛山无影脚，第二脚")
      context.stop(self)
      context.system.shutdown()
  }
}
